#!/bin/sh

#=======================================================================
# nosvn
# File ID: b45d981c-5d41-11df-ac4e-90e6ba3022ac
# Reads a bunch of filenames from stdin or files specified on the 
# command line and strips .svn directories away. Examples:
# 
#   Really clean up the working copy:
#     cd /top/of/working/copy
#     find . -type f | nosvn | xargs rm
#     svn revert -R .
#   Show the size of the working copy without the .svn directories:
#     cd /working/copy
#     find . -type f | nosvn | xargs wc -c
#
# Specifying -r (for reverse) as the first parameter lists only .svn 
# directories and their contents.
#=======================================================================

if [ "$1" = "-r" ]; then
    shift
    cat $* | egrep '/\.svn(/|$)'
else
    cat $* | egrep -v '/\.svn(/|$)'
fi
